package com.huaxin.device.dto.request;

import com.huaxin.hxenum.validation.ValidDataType;
import com.huaxin.hxenum.validation.ValidUnit;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class MetricCodeDictUpdateReqDTO {

    @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "ID不能为空")
    private Integer id;

    @Schema(description = "指标名称", example = "三相电压")
    @NotBlank(message = "指标名称不能为空")
    private String metricName;

    @Schema(description = "大类", example = "Power")
    private String category;

    @Schema(description = "数据类型：number/string", requiredMode = Schema.RequiredMode.REQUIRED, example = "number")
    @NotBlank(message = "数据类型不能为空")
    @ValidDataType
    private String dataType;

    @Schema(description = "默认单位", example = "V")
    @ValidUnit
    private String unit;

    @Schema(description = "详细说明")
    private String description;

    @Schema(description = "是否支持报警", example = "true")
    private Boolean alarmEnabled;

    @Schema(description = "下限报警值", example = "360.0000")
    private BigDecimal lowerLimit;

    @Schema(description = "上限报警值", example = "420.0000")
    private BigDecimal upperLimit;
}